package com.xjscrm.common.enums;

/**
 * 企业微信好友请求场景来源
 * @Auther: liuqi
 */
public enum WwFriendReqScene {

    WW_QR_CODE(1, "扫描二维码"),
    WW_MOBILE(2, "手机号搜索"),
    WW_CARD(3, "好友分享名片"),
    WW_GROUP(4, "群内"),
    UN_KNOW(0, "未知来源"),

    ;

    private Integer value;
    private String desc;

    WwFriendReqScene(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }


    public static WwFriendReqScene getById(Integer id) {
        if (id == null) {
            return UN_KNOW;
        }
        for (WwFriendReqScene type : WwFriendReqScene.values()) {
            if (type.getValue().equals(id)) {
                return type;
            }
        }
        return UN_KNOW;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
